<?php
namespace Emos\ListField;

use Emos\Common;

class Date extends AbstractListField {               
    function __construct() {             
    }
    
    function getHtml() {    
        $val = $this->value;
        
        if(preg_match('/^  (?<year> \d+) \- (?<month> \d+) \- (?<day> \d+)    /xui', $this->value, $m)) {    
            return "{$m['day']}.{$m['month']}.{$m['year']}";
        }
        else {
            Common::plain($this->value);
        }            
    } 
}